//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { CmsArticles, CmsArticlesResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCmsArticlesList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CmsArticlesResponse>(`/uctoo/cms_articles/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCmsArticles = async (id: string) => {
  return requestClient.get<CmsArticles>(`/uctoo/cms_articles/${id}`);
};

export const adductooCmsArticles = async (data: Partial<CmsArticles>) => {
  return requestClient.post<CmsArticles>('/uctoo/cms_articles/add', data);
};

export const edituctooCmsArticles = async (data: Partial<CmsArticles>) => {
  return requestClient.post<CmsArticles>('/uctoo/cms_articles/edit', data);
};

export const deleteuctooCmsArticles = async (id: string) => {
  return requestClient.post<any>('/uctoo/cms_articles/del', { id });
};
